﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
using Microsoft.Practices.Composite.Presentation.Commands;

namespace Douban.Core.Commands
{
    public class UIElementDoubleClickCommandBehavior : CommandBehaviorBase<UIElement>
    {
        public UIElementDoubleClickCommandBehavior(UIElement targetObject) : base(targetObject)
        {
            targetObject.MouseLeftButtonDown += (sender, e) =>
                {
                    if (e.ClickCount == 2)
                    {
                        ExecuteCommand();
                    }
                };
        }
    }
}
